package rtp.servlets;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import rtp.model.TarefaManager;

/**
 * Servlet implementation class ResolverTarefaServlet
 */
@WebServlet("/ResolverTarefaServlet")
public class ResolverTarefaServlet extends HttpServlet {
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		String dtConclusao = request.getParameter("dtConclusao");
		String descrSolucao = request.getParameter("descrSolucao");
		
		String msg = TarefaManager.resolverTarefa(dtConclusao, descrSolucao);

		request.setAttribute("msgStatus", msg);

		RequestDispatcher view = request.getRequestDispatcher("tarefaCriada.jsp");
		view.forward(request, response);
	}

	
}